/**
* @Author: 858834013@qq.com
* @Name: tab
* @Date: 2023年05月17日10:30:59
* @Desc: tab
*/
<template>
  <div class="tabs">
    <div class="tab cur" :class="{active:active==item.id}" @click="getactive(item.id)" v-for="(item,index) in list"
         :key="index"><span>{{ item.name }}</span>
    </div>
  </div>
</template>
<script>
export default {
  name: "tabs",
  components: {},
  props: {
    list: {
      type: Array,
      default() {
        return [];
      }
    },
    active: {
      type: [Number, String],
      default() {
        return 0;
      }
    },
  },
  data() {
    return {}
  },
  watch: {},
  mounted() {
  },
  methods: {
    getactive(e) {
      this.$emit('update:active', e)
    },
  }
}
</script>
<style scoped lang="scss">
.tabs {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  flex-direction: row;
  background: rgba(0, 164, 255, 0.1);
  border: 1px solid #00A4FF;
  border-radius: 4px;

  .tab {
    height: 22px;
    opacity: 1;
    display: flex;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    flex-direction: row;
    align-content: flex-start;

    span {
      font-size: 14px;
      font-family: Alibaba;
      font-weight: normal;
      color: #fff;
      padding: 0 10px;
    }
  }

  .tab.active {
    height: 22px;
    background: #00A4FF;
    border-radius: 4px;
  }
}
</style>
